package com.zbkj.dal.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum FundStatusEnums {

    NEW("NEW", "新建", "新建"),
    IN_TRANSIT("IN_TRANSIT", "在途","冻结中"),
    CANCEL("CANCEL", "取消", "取消"),
    FINISH("FINISH", "完成","已到账"),
    ;
    private final String code;
    private final String desc;
    private final String show;


    public static String getShowByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return null;
        }
        return Arrays.stream(FundStatusEnums.values()).filter(type -> StringUtils.equals(type.getCode(), code)).map(FundStatusEnums::getShow).findFirst().orElse(null);
    }
}
